<script setup lang="ts">

import { ref, nextTick } from "vue";
const count = ref(0);

import { useGlobalStore } from "@/store/modules/global";

const globalStore = useGlobalStore();

const handlePinnaAction = async () => {
  let state: any = globalStore.theme === 'dark' ? 'light' : 'dark';
  
  globalStore.setTheme(state); 

  await nextTick();

  console.log('globalStore.theme', globalStore.theme);

}


</script>

<template>
  <el-button type="primary" @click="count++">count is: {{ count }}</el-button>

  <el-button type="primary" @click="handlePinnaAction">改变主题Pinnia</el-button>
</template>

<style scoped>

</style>
